(ns qwiz.models.model
  (:require
    [noir.session :as session]))

(defn login [username password] (

  ))

(defn me []
   (if (not(=(session/get :username) nil)) @(session/get :username) nil))

(defn meref []
  (session/get :username))

(defn is-user? []
  (not (= nil (me))))

(defn login [user]
  (session/put! :username (ref user)))

(defn logout []
  (session/clear!))